<template>
  <div
    v-if="tag"
    class="em-card__tag"
  >
    <em-tag
      v-if="type==='text'"
      mark
      :type="color"
    >{{ content }}</em-tag>
    <em-image
      v-else-if="type==='image'"
      :src="content"
    />
    <em-count-down
      v-if="type==='countdown'"
      :time="content"
      type="card"
    />
  </div>
</template>

<script>
export default {
  name: 'CardTagCell',
  props: {
    value: {
      type: Object,
      required: true
    }
  },
  data() {
    return {}
  },
  computed: {
    tag() {
      return this.value
    },
    type() {
      return this.tag.type
    },
    color() {
      return this.tag.color || 'primary'
    },
    content() {
      return this.tag.value
    }
  },
  mounted() {}
}
</script>
